package com.snda.doodlepro.paint;

import com.snda.doodlepro.R;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;

public class ColorPickerDialog extends Dialog {

	private OnColorChangedListener mListener;
	private int mInitialColor;

	public ColorPickerDialog(Context context, OnColorChangedListener listener,
			int initialColor) {
		super(context);

		mListener = listener;
		mInitialColor = initialColor;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		OnColorChangedListener l = new OnColorChangedListener() {
			public void colorChanged(int color) {
				mListener.colorChanged(color);
				//dismiss();
			}
		};

		setContentView(new ColorPickView(getContext(), l, mInitialColor, this));
		setTitle(R.string.pickColorTitle);
	}
}
